#include <cstdint>
#include <iostream>

int main(){
    using ll = int64_t;
    ll n,p;
    std::cin>>n>>p;
    auto pow = [](ll b, ll e, ll m)->ll{
        b%=m;
        ll res{1};
        while(e!=0){
            if(e&1){
                res=(res*b)%m;
            }
            e>>=1;
            b=(b*b)%m;
        }
        return res;
    };
    for(ll i{1};i<=n;i++){
        std::cout<<pow(i, p-2, p)<<'\n';
    }
}